﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using HumanManagement.BusinessObjects;
using HumanManagement.DataAccess;

namespace HumanManagement.BusinessLogic
{
	public class ProfessionalKnowledgeBL
	{

		#region ***** Init Methods ***** 
		ProfessionalKnowledgeDA objProfessionalKnowledgeDA;
		public ProfessionalKnowledgeBL()
		{
			objProfessionalKnowledgeDA = new ProfessionalKnowledgeDA();
		}
		#endregion

		#region ***** Get Methods ***** 
		/// <summary>
		/// Get ProfessionalKnowledge by id
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns>ProfessionalKnowledge</returns>
		public ProfessionalKnowledge GetByID(int id)
		{
			return objProfessionalKnowledgeDA.GetByID(id);
		}

		/// <summary>
		/// Get all of ProfessionalKnowledge
		/// </summary>
		/// <returns>List<<ProfessionalKnowledge>></returns>
		public List<ProfessionalKnowledge> GetList()
		{
			string cacheName = "lstProfessionalKnowledge";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objProfessionalKnowledgeDA.GetList(), "ProfessionalKnowledge");
			}
			return (List<ProfessionalKnowledge>) ServerCache.Get(cacheName);
		}

		/// <summary>
		/// Get DataSet of ProfessionalKnowledge
		/// </summary>
		/// <returns>DataSet</returns>
		public DataSet GetDataSet()
		{
			string cacheName = "dsProfessionalKnowledge";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objProfessionalKnowledgeDA.GetDataSet(), "ProfessionalKnowledge");
			}
			return (DataSet) ServerCache.Get(cacheName);
		}


		/// <summary>
		/// Get all of ProfessionalKnowledge paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>List<<ProfessionalKnowledge>></returns>
		public List<ProfessionalKnowledge> GetListPaged(int recperpage, int pageindex)
		{
			return objProfessionalKnowledgeDA.GetListPaged(recperpage, pageindex);
		}

		/// <summary>
		/// Get DataSet of ProfessionalKnowledge paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>DataSet</returns>
		public DataSet GetDataSetPaged(int recperpage, int pageindex)
		{
			return objProfessionalKnowledgeDA.GetDataSetPaged(recperpage, pageindex);
		}





		#endregion

		#region ***** Add Update Delete Methods ***** 
		/// <summary>
		/// Add a new ProfessionalKnowledge within ProfessionalKnowledge database table
		/// </summary>
		/// <param name="obj_professionalknowledge">ProfessionalKnowledge</param>
		/// <returns>key of table</returns>
		public int Add(ProfessionalKnowledge obj_professionalknowledge)
		{
			ServerCache.Remove("ProfessionalKnowledge", true);
			return objProfessionalKnowledgeDA.Add(obj_professionalknowledge);
		}

		/// <summary>
		/// updates the specified ProfessionalKnowledge
		/// </summary>
		/// <param name="obj_professionalknowledge">ProfessionalKnowledge</param>
		/// <returns></returns>
		public void Update(ProfessionalKnowledge obj_professionalknowledge)
		{
			ServerCache.Remove("ProfessionalKnowledge", true);
			objProfessionalKnowledgeDA.Update(obj_professionalknowledge);
		}

		/// <summary>
		/// Delete the specified ProfessionalKnowledge
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns></returns>
		public void Delete(int id)
		{
			ServerCache.Remove("ProfessionalKnowledge", true);
			objProfessionalKnowledgeDA.Delete(id);
		}
		#endregion
	}
}
